﻿@using GBFinance.Web.Models;
@using HiLand.Utility4.MVC.Data;
@model BrokerEntity
@{
    this.Layout = null;
    ViewBag.Title = "_BrokerInformation";
    BrokerEntity brokerEnity = BrokerEntity.Empty;
    if (Model != null)
    {
        brokerEnity = Model;
    }

    bool isDisplaySubmitButton = this.GetPassedParam<BrokerEntity, bool>("isDisplaySubmitButton");
}
<div id="innerFormContainer">
    <style type="text/css">
        #innerFormContainer td
        {
            vertical-align:middle;
            }
            
            #innerFormContainer td label
        {
            text-align:right;
            }
    </style>
    @using (Html.BeginForm())
    {
        <table width="100%">
            <tr>
                <td>
                    <label>
                        Username</label>
                </td>
                <td>
                    <input class="text-input" name="userName" type="text"  value="@brokerEnity.UserName" />
                </td>
                <td>
                    <label>Email</label>
                </td>
                <td>
                    <input class="text-input" name="UserEmail" type="text"  value="@brokerEnity.UserEmail"  />
                </td>
            </tr>
            @if (brokerEnity.IsEmpty)
            {
                <tr>
                    <td>
                        <label>
                            Password</label>
                    </td>
                    <td>
                        <input class="text-input" name="password" type="password" />
                    </td>
                    <td>
                        <label>
                            Password Confirm</label>
                    </td>
                    <td>
                        <input class="text-input" name="passwordConfirm" type="password" />
                    </td>
                </tr>
            }
            <tr>
                <td>
                    <label>
                        First Name</label>
                </td>
                <td>
                    <input class="text-input" name="UserNameFirst" type="text"  value="@brokerEnity.UserNameFirst" />
                </td>
                <td>
                    <label>
                        Last Name</label>
                </td>
                <td>
                    <input class="text-input" name="UserNameLast" type="text"  value="@brokerEnity.UserNameLast" />
                </td>
            </tr>
            <tr>
                <td>
                    <label>
                        Company Name</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerCompanyName" type="text"  value="@brokerEnity.BrokerCompanyName" />
                </td>
                <td>
                    <label>
                        ABN</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerABN" type="text"  value="@brokerEnity.BrokerABN" />
                </td>
            </tr>
            <tr>
                <td>
                    <label>
                        Phone number</label>
                </td>
                <td>
                    <input class="text-input" name="WorkTelphone" type="text"  value="@brokerEnity.WorkTelphone" />
                </td>
                <td>
                    <label>
                        Mobile number</label>
                </td>
                <td>
                    <input class="text-input" name="UserMobileNO" type="text"  value="@brokerEnity.UserMobileNO" />
                </td>
            </tr>
            <tr>
                <td>
                    <label>
                        Address</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerAddress" type="text"  value="@brokerEnity.BrokerAddress" />
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <label>
                        Bank</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerBank" type="text" value="@brokerEnity.BrokerBank" />
                </td>
                <td>
                    <label>
                        BSB</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerBSB" type="text"  value="@brokerEnity.BrokerBSB" />
                </td>
            </tr>
            <tr>
                <td>
                    <label>
                        Account Number</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerBankAccountNumber" type="text" value="@brokerEnity.BrokerBankAccountNumber" />
                </td>
                <td>
                    <label>
                        Account Name</label>
                </td>
                <td>
                    <input class="text-input" name="BrokerBankAccountName" type="text" value="@brokerEnity.BrokerBankAccountName"/>
                </td>
            </tr>
        </table>
        <input type="hidden" name="UserGuid" value="@brokerEnity.UserGuid"  />
    }
</div>
@if (isDisplaySubmitButton == true)
{ 
    <p>
        <input class="button" type="button" id="btnSave" value="Save" />
    </p>
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#btnSave").click(function () {
            submitAndRedirect("#innerFormContainer form");
        });
    });
</script>
